!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define("rb_wixui.thunderbolt[StateBox]",["react","reactDOM"],t):"object"==typeof exports?exports["rb_wixui.thunderbolt[StateBox]"]=t(require("react"),require("react-dom")):e["rb_wixui.thunderbolt[StateBox]"]=t(e.React,e.ReactDOM)}("undefined"!=typeof self?self:this,(function(e,t){return function(){var n={5329:function(t){"use strict";t.exports=e},95561:function(e){"use strict";e.exports=t},448:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const n=[];return e&&n.push(`${l}${e}`),t.forEach((e=>{e&&(n.push(`${l}${e}`),n.push(e))})),n.join(" ")};const u=()=>"function"==typeof window.IntersectionObserver;const d={left:"onSwipeLeft",right:"onSwipeRight",up:"onSwipeUp",down:"onSwipeDown"},p=e=>{if(e.touches&&e.touches.length){const t=e.touches[0];return{x:t.pageX,y:t.pageY}}},f={touched:!0,moved:!1,deltaCoords:{x:0,y:0}},h=(e,t,n)=>()=>{let r;const o=e=>{r={...f,numOfTouches:e.touches.length,startCoords:p(e),startTime:Date.now(),evObj:{...e}}},i=e=>{if(!r)return;const t=p(e);if(t){r.startCoords||(r.startCoords=t);const e=r.startCoords.x-t.x,n=r.startCoords.y-t.y;r.moved=!0,r.deltaCoords={x:e,y:n}}},s=()=>{if(r)if(r.endTime=Date.now(),"onTap"===e&&(e=>e.touched&&!e.moved&&1===e.numOfTouches)(r))t(r.evObj);else if((e=>e.moved&&1===e.numOfTouches&&e.endTime-e.startTime<500&&(Math.abs(e.deltaCoords.x)>100||Math.abs(e.deltaCoords.y)>60))(r)){const n=((e,t)=>{let n;return n=Math.abs(e)>Math.abs(t)?e>0?"left":"right":t>0?"up":"down",n})(r.deltaCoords.x,r.deltaCoords.y);e===d[n]&&t(r.evObj)}};return n&&n.current&&(n.current.addEventListener("touchstart",o,{passive:!0}),n.current.addEventListener("touchmove",i,{passive:!0}),n.current.addEventListener("touchend",s,{passive:!0})),()=>{n&&n.current&&(n.current.removeEventListener("touchstart",o),n.current.removeEventListener("touchmove",i),n.current.removeEventListener("touchend",s))}},v=(t,n,r)=>e.useEffect(h(t,n,r),[t,r,n]),m="Slideshow",x="Next",E="Previous",g="Slides",b="slidesWrapper",y="nextButton",S="prevButton",C="shadowLayer",w="NoTransition";var O={root:"slideshow"};var N,k={root:"multi-state-box"},P={thinArrowsSkin:"JMUd8Z","slide-show-container":"mDzRgi",slideShowContainer:"mDzRgi",thinArrowsLargeSelectedCircleSkin:"QodGTM","nav-btn":"XvQ3FE",navBtn:"XvQ3FE","prev-btn":"CdshHv",prevBtn:"CdshHv","next-btn":"Qinjwp",nextBtn:"Qinjwp",slides:"hDJzl4","in-transition":"tAoGqR",inTransition:"tAoGqR","slides-dynamic-height":"T23gn7",slidesDynamicHeight:"T23gn7",shadowLayer:"N2NGoO","dots-nav-section":"lZ5yqT",dotsNavSection:"lZ5yqT","dots-nav-list":"dZxZOk",dotsNavList:"dZxZOk","nav-dot":"ZVUGJp",navDot:"ZVUGJp",selected:"Ale4Rm",longArrowsLargeSelectedCircleSkin:"ENJ6Ca",squareButtonsSkin:"ghJlnq",StateBoxSkin:"XVHXq_",stateBoxSkin:"XVHXq_"};function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;tnull};var I=t=>{let{skin:n,moveToNextSlide:r,moveToPrevSlide:o,translations:i}=t;const s=B[n];return e.createElement(e.Fragment,null,e.createElement("button",{"data-testid":S,"aria-label":i.prevButtonAriaLabel||E,onClick:o,className:a(P.navBtn,P.prevBtn)},e.createElement(s,null)),e.createElement("button",{"data-testid":y,"aria-label":i.nextButtonAriaLabel||x,onClick:r,className:a(P.navBtn,P.nextBtn)},e.createElement(s,null)))};var V=t=>{let{translations:n,currentSlideIndex:r,slidesProps:o,isPlaying:i,focusSlideShow:s,changeSlide:l}=t;return e.createElement("nav",{"aria-label":n.navDotsAriaLabel||g,className:P.dotsNavSection},e.createElement("ol",{className:P.dotsNavList},o.map(((t,n)=>((t,n)=>e.createElement("li",{key:t.id,"aria-current":n===r?"true":void 0},e.createElement("a",{href:"./#"+t.id,"aria-label":t.title,onClick:e=>{e.preventDefault(),e.stopPropagation(),n!==r&&l(n),i||s()},className:a(P.navDot,{[P.selected]:n===r})})))(t,n)))))};function H(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{reverse:n,...o}=t;return e.createElement(de,r()({},o,{classNames:{enter:pe,enterActive:fe,exit:he,exitActive:ve}}),t.children)},OutIn:t=>{const{reverse:n,...o}=t;return e.createElement(de,r()({},o,{classNames:{enter:me,enterActive:xe,exit:Ee,exitActive:ge}}),t.children)},SlideHorizontal:t=>{const{reverse:n,...o}=t;return e.createElement(de,r()({},o,{classNames:n?{enter:we,enterActive:Oe,exit:Ne,exitActive:ke}:{enter:be,enterActive:ye,exit:Se,exitActive:Ce}}),t.children)},SlideVertical:t=>{const{reverse:n,...o}=t;return e.createElement(de,r()({},o,{classNames:n?{enter:je,enterActive:Me,exit:Re,exitActive:De}:{enter:Pe,enterActive:Ae,exit:Le,exitActive:Te}}),t.children)}};var Ie=t=>{const n=Be[t.type],{type:r,...o}=t;return e.createElement(n,o)};const Ve=(t,n)=>{let{isPlaying:r,isSlideShowInViewport:o,reverse:i,transition:s,transitionDuration:l,currentSlideIndex:c,onSlideEntered:u,onSlideExited:d,children:p,dynamicHeight:f,inTransition:h}=t;const v=!o||r&&o?"off":"polite",m="SlideVertical"===s||"SlideHorizontal"===s;return"NoTransition"===s?e.createElement("div",{ref:n,"data-testid":b,className:a(P.slides,f?P.slidesDynamicHeight:void 0),"aria-live":v},p):e.createElement("div",{ref:n,"data-testid":b,"aria-live":v,className:a(P.slides,f?P.slidesDynamicHeight:void 0,h&&m?P.inTransition:void 0)},e.createElement($,{component:null,childFactory:t=>e.cloneElement(t,{reverse:i})},e.createElement(Ie,{type:s,key:c,timeout:l,onEntered:u,onExited:d,unmountOnExit:!0},p)))};var He=e.forwardRef(Ve);const _e=(t,n)=>{const{id:o,className:i,customClassNames:s=[],skin:l,hasShadowLayer:d,translations:p,currentSlideIndex:f,slidesProps:h,showNavigationDots:x,showNavigationButton:E,autoPlay:g,shouldChangeSlidesOnSwipe:b=!0,autoPlayInterval:y,pauseAutoPlayOnMouseOver:S,transition:N,transitionDuration:A,transitionReverse:L,changeSlide:T,reducedMotion:j,children:M,onCurrentSlideChanged:R,onChange:D,onMouseEnter:B,onMouseLeave:H,onClick:_,onDblClick:q,play:F,onPlay:z,pause:U,onPause:X,isPlaying:Z=g&&e.Children.toArray(M()).length>1&&!j,dynamicSlidesHeight:G=!1,observeChildListChange:J}=t,[$,Q]=e.useState(!1),[W,Y]=e.useState(!1),K=e.useRef(null),ee=!j&&N!==w,te=L?!$:$,ne=e.Children.toArray(M()),re=g&&ne.length>1&&!j,oe=e.useRef(null),ie=e.useCallback((e=>{let{slideIndex:t,isBackward:n,callback:r}=e;if(W||t===f)"function"==typeof r&&r();else{if(ee&&"function"==typeof r&&(oe.current=r),ee){Y(!0);Q(!!(void 0===n?t{U(),null==B||B(e)}:B,ce=re&&S?e=>{F(),null==H||H(e)}:H,ue=re?{onFocus:()=>U(),onBlur:()=>F()}:{},de=e.useRef(null),pe=function(t,n){void 0===n&&(n=!1);const[r,o]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{if(!u())return o(n),()=>{};const e=t.current;if(e&&u()){const t=new window.IntersectionObserver((e=>{const t=e[e.length-1];o(t.isIntersecting)}));return t.observe(e),()=>{t.disconnect()}}return()=>{}}),[t,n]),r}(de);v("onSwipeLeft",(()=>b&&se()),de),v("onSwipeRight",(()=>b&&ae()),de),function(t,n){const r=(0,e.useRef)((()=>{}));(0,e.useEffect)((()=>{r.current=t}),[t]),(0,e.useEffect)((()=>{if(null!==n){const e=setInterval((function(){r.current()}),n);return()=>clearInterval(e)}return()=>{}}),[n])}(se,Z&&pe?y:null);const fe=e.useCallback((()=>({height:{[o]:()=>{const e=document.getElementById(o);return e?e.clientHeight:0}}})),[o]);e.useImperativeHandle(n,(()=>({play:()=>{F(),null==z||z({type:"autoplayOn"})},pause:()=>{U(),null==X||X({type:"autoplayOff"})},moveToSlide:ie,next:se,previous:ae,getCustomMeasures:fe})),[se,ae,ie,fe,X,z,U,F]);const he="StateBoxSkin"===l?k.root:O.root;return e.useEffect((()=>{J&&null!=K&&K.current&&J(o,K.current)}),[]),e.createElement("div",r()({id:o},(e=>Object.entries(e).reduce(((e,[t,n])=>(t.includes("data-")&&(e[t]=n),e)),{}))(t),{ref:de,className:a(i,P.slideShowContainer,P[l],"ignore-focus",c(he,...s)),role:"region",tabIndex:-1,"aria-label":p.slideShowAriaLabel||m,onClick:_,onDoubleClick:q,onMouseEnter:le,onMouseLeave:ce},ue),E&&e.createElement(I,{skin:l,translations:p,moveToNextSlide:se,moveToPrevSlide:ae}),d&&e.createElement("div",{"data-testid":C,className:P.shadowLayer}),e.createElement(He,{ref:K,isPlaying:Z,isSlideShowInViewport:pe,reverse:te,transition:j?w:N,transitionDuration:A,currentSlideIndex:f,inTransition:W,onSlideEntered:()=>{ee&&Y(!1)},onSlideExited:()=>{null==R||R(f),oe.current&&(oe.current(),oe.current=null)},dynamicHeight:G},ne[f]),x&&e.createElement(V,{focusSlideShow:()=>{var e;return null==(e=de.current)?void 0:e.focus()},translations:p,slidesProps:h,currentSlideIndex:f,changeSlide:e=>{ie({slideIndex:e})}}))};var qe=e.forwardRef(_e);const Fe=(t,n)=>{const r={dynamicSlidesHeight:!0,shouldChangeSlidesOnSwipe:!1,autoPlayInterval:1e3,pauseAutoPlayOnMouseOver:!1,transitionReverse:!1,showNavigationDots:!1,showNavigationButton:!1,slidesProps:[],autoPlay:!1,...t,ref:n};return e.createElement(qe,r)};const ze=e=>e.replace(/([A-Z])/g,(e=>`-${e.toLowerCase()}`));var Ue;const Xe={StateBox:{component:e.forwardRef(Fe),controller:(Ue=e=>{let{mapperProps:t,controllerUtils:n,stateValues:r}=e;return{...t,changeSlide:e=>{n.updateProps({currentSlideIndex:e})},observeChildListChange:t.isMasterPage?r.observeChildListChangeMaster:r.observeChildListChange}},{useComponentProps:(e,t,n)=>{const r=(e=>({...e,updateStyles:t=>{const n=Object.entries(t).reduce(((e,[t,n])=>{return{...e,[(r=t,r.startsWith("--")?t:ze(t))]:void 0===n?null:n};var r}),{});e.updateStyles(n)}}))(n);return Ue({mapperProps:e,stateValues:t,controllerUtils:r})}})}}}(),i}()})); //# sourceMappingURL=https://static.parastorage.com/services/editor-elements-library/dist/thunderbolt/rb_wixui.thunderbolt[StateBox].3b96413c.bundle.min.js.map